/**
 * Copyright 2008-2009 HAN.BIFANG
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */
package han.bifang.gwt.client.sec;

import han.bifang.gwt.client.common.GwtContext;
import han.bifang.gwt.client.communicate.BifangGWTServiceAsync;
import han.bifang.gwt.client.sec.content.GroupTab;
import han.bifang.gwt.client.sec.content.RoleTab;
import han.bifang.gwt.client.sec.content.UserTab;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.TabPanel;


/**
 * 
 * @Author Kent
 */
public class SecurityTab extends Composite {
	private SecurityMessages cons = null;

	private BifangGWTServiceAsync service = null;

	private GwtContext context = null;

	
	public SecurityTab(BifangGWTServiceAsync service, GwtContext context) {
		this.service = service;
		this.context = context;
		
		cons = GWT.create(SecurityMessages.class);

		TabPanel tabs = new TabPanel();
		UserTab userTab = new UserTab(cons,service,context);
		userTab.setWidth("100%");
		
		GroupTab groupTab = new GroupTab(cons,service,context);
		groupTab.setWidth("100%");
		
		RoleTab roleTab = new RoleTab(cons,service,context);
		roleTab.setWidth("100%");
		
		tabs.add(userTab,cons.user());
		tabs.add(groupTab,cons.group());
		tabs.add(roleTab,cons.role());
		tabs.selectTab(0);
		
		initWidget(tabs);
		

	}
}
